//This code was created with the help of Cairngorm Creator by Tyler Beck.
//The portions of this document created by Cairngorm Creator 
//are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
//CONDITIONS OF ANY KIND, either express or implied.
//========================================================



package net.optix.ip.vo 
{
	public class ActionVO
	{
		public static var officeActionTypeArray:Array		=	["Non-Final","Final",'Advisory Action', 'Non-compliant Brief','Response to Appeal'];
		public static var officeResponseType:Array	=	['Response', 'RCE', 'Correction', 'Notice of Appeal', 'Appeal Brief', 'Reply Brief'];
		public static var actionType:Array		=	["Disclosure","Draft","Filed","Response","Payment"];
		
		public var actionID:int;
		public var title:String;
		public var inventionID:int;
		public var type:int;
		public var description:String;
		public var keyWords:String;
		public var userPost:String;
		public var date:String;
		public var dueDate:String;
		public var fileNames:String;
		
		public var officeActionResponse:String;
		public var officeActionMailed:String;
		public var officeActionType:String;
		public var officeActionTypeInt:int;
		public var goesAbandoned:String;
		public var comments:String;
		public var responseField:String;
		public var responseType:int;
		public var responseTypes:String;
		public var responseDate:String;
		
		public var fillingDate:String;
		public var serialNumber:String;
		
		public var cost:Number	=	0;
		public var responseActionID:int;
		
		public var actionMailed:String;
		public var responseDueDate:String;
		public var expectedBudget:Number;
		
		public var inventionType:int;
		
		public static function purseAction(value:XML):ActionVO
		{
			var vo:ActionVO	=	new ActionVO();
			
			try
			{
				vo.actionID	=	value.ActionID;
				vo.inventionID=	value.InventionID;
				vo.date		=	value.Date;
				vo.dueDate	=	ActionVO.assetDate(value.DueDate);
				vo.cost		=	value.Cost;
				vo.officeActionMailed	=	ActionVO.assetDate(value.OfficeActionMailed);
				vo.officeActionResponse	=	ActionVO.assetDate(value.OfficeActionResponse);
				
				vo.officeActionTypeInt	=	value.OfficeActionType;
				if(vo.officeActionTypeInt == -1)
				{
					vo.officeActionType	=	"";
				}
				else
				{
					vo.officeActionType		=	ActionVO.officeActionTypeArray[value.OfficeActionType];
				}
				
				vo.comments				=	value.Comments;
				vo.goesAbandoned		=	ActionVO.assetDate(value.GoesAbandoned);
				vo.responseTypes			=	ActionVO.officeResponseType[value.ResponseType];
				vo.responseType			=	value.ResponseType;
				vo.responseField		=	ActionVO.assetDate(value.ResponseField);
				vo.expectedBudget		=	value.ExpectedBudget;

				
			}
			catch(error:Error){}
			
			return vo;
		}
		
		public static function assetDate(value:String):String
		{
			if(value == "0000-00-00")
			{
				return "";
			}
			else
			{
				return value;
			}
		}
	}
}